{% extends "mock/base.html" %}
{% block title%}<title>路由列表</title>{% endblock %}

{% block content %}
    <div class="container theme-showcase" role="main">

      <!--查询-->
      <div class="page-header" style="margin-top: 80px;">
        <div id="navbar" class="navbar-collapse collapse" style="float:left;">
          <form class="navbar-form" method="get" action="/server_list/">
            <div class="form-group">
              <input name="router_name" type="text" placeholder="name" class="form-control" >
            </div>
            <button type="submit" class="btn btn-success" >搜索</button>
          </form>
        </div><!--/.navbar-collapse -->
        <div style="float:right;">
          <button type="submit" class="btn btn-primary" onclick="window.location.href='{% url 'add_router' %}'" style="margin-top: 8px;">添加</button>
        </div>
      </div>

      <!--表单-->
      <div class="row" >
        <div class="col-md-6" style="width: 900px;">
          <table class="table table-striped">
            <thead>
              <tr>
                <th>name</th>
                <th>path</th>
                <th>server</th>


              </tr>
            </thead>
            <tbody>
                {% for server in server_list %}
                    <tr>
                      <td>{{ server.name }}</td>
                      <td>{{ server.path }}</td>
                      <td>{{ server.server }}</td>
                      <td><a href="{% url "editrouter" router.id %}" >编辑</a></td>
                      <td><a href="{% url "delrouter" router.id %}">删除</a></td>
                </tr>
                {% endfor %}
            {% if error_msg %}
                <p>{{ error_msg }}</p>
            {% endif %}
            </tbody>
          </table>
        </div>

      </div>
</div>



{% endblock %}